﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenMUD.Kernel.Interface.Client;
using Open_MUD.Kernel.Interface.Client;
using Open_MUD.Kernel;

namespace Open_MUD.Mudlib.Cmds
{
    class Alias:CommandBase
    {
       public Alias(Cliente c):base(c,"alias",0)
       {
          ignoreGlobalCD = true;
       }
       public override void executeCMD(string cmd)
       {
           base.executeCMD(cmd);
           string[] palabras = this.args.Split(' ');
           string alias = "";
           if (palabras.Length < 2)
               throw new MudException("¿alias "+palabras[0]+" qué?");

           for (int i = 1; i < palabras.Length ; i++)
               alias += palabras[i] + " ";
           this.cliente.AddAlias(palabras[0], alias);
           this.cliente.render("Alias " + palabras[0] + " añadido.");
       }
    }
}
